package com.uniview.entity.vo;

import com.uniview.enums.EAndOR;
import com.uniview.enums.EMatchMode;

/**
 * 查询条件
 * 
 * @author admin
 * 
 */
public class Query {

	/**
	 * 衔接类型 (And... Or... ) 默认 And
	 */
	private EAndOR andOr;

	/**
	 * 字段名
	 */
	private String colName;

	/**
	 * 字段值匹配模式
	 */
	private EMatchMode matchMode;

	/**
	 * 字段值
	 */
	private Object[] colVal;
	
	public Query(String colName, EMatchMode matchMode,
			Object... colVal) {
		this.colName = colName;
		this.matchMode = matchMode;
		this.colVal = colVal;
	}

	public Query(EAndOR andOr, String colName, EMatchMode matchMode,
			Object... colVal) {
		this.andOr = andOr;
		this.colName = colName;
		this.matchMode = matchMode;
		this.colVal = colVal;
	}

	public EAndOR getAndOr() {
		return andOr == null ? EAndOR.AND : andOr; // 默认 "AND"
	}

	public void setAndOr(EAndOR andOr) {
		this.andOr = andOr;
	}

	public String getColName() {
		return colName;
	}

	public void setColName(String colName) {
		this.colName = colName;
	}

	public Object[] getColVal() {
		return colVal;
	}

	public void setColVal(Object... colVal) {
		this.colVal = colVal;
	}

	public EMatchMode getMatchMode() {
		return matchMode;
	}

	public void setMatchMode(EMatchMode matchMode) {
		this.matchMode = matchMode;
	}

}
